<script type="text/javascript">
$(document).ready(function(){
	parent.showButton("sendsms");
});

function doButton(btn){
    if(btn == "sendsms"){
        $("#form").submit();
	}
}

function getClass(grade_id){
	$.getJSON("__URL__/getClass",{grade_id:grade_id},function(data){
		$("#class_id").html("<option value=\"\">请选择</option>");
    	$("#class_id").append(data.message);
	});	
}

function getStudent(class_id){
	var grade_id = $("#grade_id").val();
	$.getJSON("__URL__/getStudent",{grade_id:grade_id,class_id:class_id},function(data){
    	$("#student").html(data.student);
	});	
}

function addAccept(id){
	var is_check = $("#student_"+id).attr("checked");
	var card = $("#accept").val();
	var post_card = $("#mobile_"+id).html();
	if(is_check){
		$("#accept").val(card+post_card);
	}else{
		alert("本号码已添加，若要取消，请在输入框手动删除相应数据");
	}
}

</script>

  <div class="content">
    <form action="__URL__/index_act/act/{$act}" method="post" enctype="multipart/form-data" id="form">
    <input type="hidden" name="act" id="act" value="{$act}" />
    <input type="hidden" name="id" value="{$info.id}" />
      <table class="form" style="width:48%; float:left">
        <tr>
          <td style="border:none"><span class="required">*</span>用户：</td>
          <td style="border:none"><textarea id="accept" name="accept"></textarea>多个电话号码用分号区分</td>
        </tr>
        <tr>
          <td style="border:none"><span class="required">*</span>短信：</td>
          <td style="border:none"><textarea name="content" id="content"></textarea></td>
        </tr>
      </table>
    </form>
    
     <table class="form" style="width:48%; float:left;">
       <tr>
         <td style="border:none"><span class="required">*</span><a href="#" onclick=></>年级：</td>
         <td style="border:none">
         	<select name="grade_id" id="grade_id" onchange="getClass(this.value)">
         		<option value="">请选择</option>
         	  <volist name="Grade" id="val">
         		<option value="{$val.id}" <if condition="$info[grade_id] eq $val[id]">selected</if> >{$val.name}</option>
         	  </volist>
         	</select>
         </td>
       </tr>
       <tr>
         <td style="border:none"><span class="required">*</span>班级：</td>
         <td style="border:none">
           <select id="class_id" name="class_id"  onchange="getStudent(this.value)">
         		<option value="">请选择</option>
         	</select>
         </td>
       </tr>
       <tr>
         <td style="border:none"><span class="required">*</span>学生：</td>
         <td id="student" style="border:none"></td>
       </tr>
     </table>
  </div>